package com.jwtproject.bootserver.status;



/**
 * @Description：系统状态枚举
 **/
public enum SystemStatusEnum {
    //登录
    ACCOUNT_LOCKED("登录失败，账户被锁定，请联系管理员进行解锁！", StatusCode.LOCKED),
    ACCOUNT_DISABLE("登录失败，账户被禁用，请联系管理员！", StatusCode.AUTHENTICATION_FAILED),
    ACCOUNT_EXPIRED("登录失败，账户已过期！", StatusCode.AUTHENTICATION_FAILED),
    PASSWORD_EXPIRED("登录失败，密码已过期！", StatusCode.AUTHENTICATION_FAILED),
    USERNAME_PASSWORD_ERROR("登录失败，用户名或密码错误！", StatusCode.AUTHENTICATION_FAILED),
    LOGIN_FAIL_LIMITED("登录错误次数超过限制！", StatusCode.AUTHENTICATION_FAILED),
    OTHER_CLIENT_LOGIN_IN("其他人登录了这个账户", StatusCode.SINGLE_LOGIN),

    //用户
    USER_ALREADY_EXISTS("该用户已存在！", StatusCode.INTERNAL_SYSTEM_ERROR),
    USER_NAME_CANNOT_BE_NULL("用户名不能为空", StatusCode.INTERNAL_SYSTEM_ERROR),
    USER_NO_FOUNT("系统错误，用户不存在！", StatusCode.INTERNAL_SYSTEM_ERROR),
    USER_NO_PASSWORD("密码不能为空！", StatusCode.INTERNAL_SYSTEM_ERROR),
    USER_NOT_PASSWORD("密码过于简单,以字母开头，长度在6~18之间，只能包含字母、数字和下划线！", StatusCode.INTERNAL_SYSTEM_ERROR),
    USER_NOT_PHONE("电话号码格式不正确！", StatusCode.INTERNAL_SYSTEM_ERROR),
    USER_NOT_EMAIL("邮箱格式不正确！", StatusCode.INTERNAL_SYSTEM_ERROR),
    USER_PWD_CHECK_FILD("密码校验失败！", StatusCode.AUTHENTICATION_FAILED),

    //权限
    LOGIN_OUT_OF_DATE("登录过期，请重新登录！", StatusCode.TOKEN_TIMEOUT),
    PERMISSION_DENIED("访问被拒绝，您没有该操作的权限！", StatusCode.PERMISSION_FAILED),
    TOKEN_AUTH_FAILED("认证失败，请重新登录！", StatusCode.ILLEGAL_TOKEN),

    // websocket
    SOCKET_USER_OFF_LINE("用户未在线", StatusCode.SOCKET_ERROR),

    //系统操作
    CHANGE_ROLE_MENU_FILED("角色菜单权限修改失败！", StatusCode.INTERNAL_SYSTEM_ERROR),
    CHANGE_ROLE_PERMISSION_FILED("角色系统操作权限修改失败！", StatusCode.INTERNAL_SYSTEM_ERROR),

    //文件上传
    UPLOAD_NULL_FILE("上传失败，文件为空！", StatusCode.INTERNAL_SYSTEM_ERROR),
    UPLOAD_FILE_FILED("文件上传失败", StatusCode.INTERNAL_SYSTEM_ERROR),

    //文件下载
    FILE_NO_FOUND("文件不存在！", StatusCode.INTERNAL_SYSTEM_ERROR),

    // APP
    APK_NO_FIND("APK文件不存在", StatusCode.INTERNAL_SYSTEM_ERROR),

    //API
    GENERATE_WITH_NULL_ID("生成失败，API ID为空", StatusCode.INTERNAL_SYSTEM_ERROR);


    public final int code;
    public final String desc;

    SystemStatusEnum(String desc, int code) {
        this.code = code;
        this.desc = desc;
    }
}
